<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Logowanie</title>
</head>
<body>

<form name="myform" action="" method="POST">
  Username: <input type="text" id="user" name="u"/><br/>
  Password: <input type="password" id="pass" name="p"/>
  <input type="button" onclick="go();"/>
</form>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript">
  function go() {
	  console.log('LuteResponse');  
  //var user=$('#user').val(), pass=$('#pass').val();
  var vendor = 
  {
    //login: "jkowalski",
    //password: "admin",
    //clientId: 2,
    //firstName: "admin",
    //lastName: "adzio",
    //email: "admin2@gmail.com",
    //client: "newClientName",
    //sendMailRemainder: "2013-02-02",
    //deadlineToCloseAccountingPeriod: "2013-03-03",
    //employeeId: 4,
//  	"employeeIds": [
// 		 {"employeeId":"4"
// 		 },
// 	],
    //reason: "Bledne wpisy w kalendarzu",
   // email: "raphaelsender@gmail.com",
    //from: "2013-02-01",
    "calendarEntries": [
		{"companyCategory":"workClient",
		 "creativeHours":"0", 
		 "date":"2013-05-01",
		 "hours":"21"},
		 {"companyCategory":"workClient",
			 "creativeHours":"0", 
			 "date":"2013-05-03",
			 "hours":"17"},
		 {"companyCategory":"workClient",
			 "creativeHours":"0", 
			 "date":"2013-05-03",
			 "hours":"9"},
	]
  };
    $.ajax('/lute/calculateCreativeHours', {
      type: 'POST',
      contentType: 'application/json',
      
      //data: JSON.stringify({username:user, password:pass}),
      data: JSON.stringify(vendor),
      complete: function() { console.log('LuteResponse');/* Do something with the response. */ }
    });
    return false; // Prevent form submit.
  };
</script>

</body>
</html>